const request = require('request');
exports.postWord = function (app) {
  app.post('/word', (req, res) => {
    request("https://api.uixsj.cn/hitokoto/get?type=fart&code=json", function (error, response, body) {
      if (!error && response.statusCode == 200) {
        body = JSON.parse(body);
        res.json({
          code: 1,
          msg: body.content
        })
        return;
      }
    })
  })
}